package org.brownflat.watergate.resources.mysql;

import org.brownflat.watergate.resources.MySqlUpgrade;
import org.springframework.stereotype.Component;

/**
 * <p>&copy Rupert Jones 2011,2012</p>
 *
 * @author rup
 */
@Component
public class Upgrade0018AllGroup implements MySqlUpgrade {

    private static final int VERSION = 18;

    @Override
    public int getSequence() {
        return VERSION;
    }

    @Override
    public String getSql() {
        return "INSERT INTO wgate_group (id, name, def_group, created_at, updated_at) VALUES (1, 'All users', 1, current_timestamp, current_timestamp);\n" +
                "INSERT INTO wgate_user_group (id, user_id, group_id) VALUES (1, 1, 1);\n";
    }

    @Override
    public String getName() {
        return "Create default group";
    }
}
